Platform Explorer / Nuxeo Platform 2021.49

Extension point policies

Documentation

Extension point defining versioning policies for documents. Contributions to this extension point are available for VersioningService implementing ExtendableVersioningService interface.

Example:

    <policy beforeUpdate="true"
        id="no-versioning-for-system-before-update" increment="NONE" order="1">
        <filter-id>system-document</filter-id>
    </policy>
    <policy id="no-versioning-for-system-after-update" increment="NONE" order="1">
        <filter-id>system-document</filter-id>
    </policy>
    <policy id="versioning-with-initial-version" increment="MINOR" order="2">
        <initialState major="1" minor="0"/>
    </policy>

The beforeUpdate attribute enables, if set to true, to apply versioning before the actual update of the document. The default value for this attribute is false.

The increment attribute defines which version number (minor or major) have to be incremented. The available options for this attribute are : - NONE - MINOR - MAJOR

The order attribute defines in which order the policies should be taken into account. They are taken in ascending order.

Initial state is the initial version number of the document. Default is 0.0.

Each policy contains one or multiple filters defining under which conditions the document should be versioned (Note that filters for a policy are OR-ed).

@since 9.1

Aliases

  • org.nuxeo.ecm.core.versioning.VersioningService--policies

Contribution Descriptors

  • Class: org.nuxeo.ecm.core.versioning.VersioningPolicyDescriptor

Existing Contributions

Contributions are presented in the same order as the registration order on this extension point. This order is displayed before the contribution name, in brackets.

  • nuxeo-core-2021.49.2.jar /OSGI-INF/versioning-default-policies.xml
    <extension point="policies" target="org.nuxeo.ecm.core.api.versioning.VersioningService">
        <policy beforeUpdate="true" id="no-versioning-for-system-before-update" increment="NONE" order="1">
          <filter-id>system-document</filter-id>
        </policy>
        <policy id="no-versioning-for-system-after-update" increment="NONE" order="1">
          <filter-id>system-document</filter-id>
        </policy>
        <policy beforeUpdate="true" id="disable-versioning-before-update" increment="NONE" order="2">
          <filter-id>disable-versioning</filter-id>
        </policy>
        <policy id="disable-versioning-after-update" increment="NONE" order="2">
          <filter-id>disable-versioning</filter-id>
        </policy>
        <policy id="note-as-wiki" increment="MINOR" order="50">
          <filter-id>note-filter</filter-id>
        </policy>
        <policy beforeUpdate="true" id="collaborative-save" increment="MINOR" order="100">
          <filter-id>last-contributor-different-filter</filter-id>
        </policy>
      </extension>
  • nuxeo-drive-core-2021.49.2.jar /OSGI-INF/nuxeodrive-versioning-policy-contrib.xml
    <extension point="policies" target="org.nuxeo.ecm.core.api.versioning.VersioningService">
        <policy beforeUpdate="true" id="versioning-delay" increment="MINOR" order="150">
          <filter-id>versioning-delay</filter-id>
          <filter-id>drive-filter</filter-id>
          <filter-id>not-folderish</filter-id>
        </policy>
      </extension>
  • nuxeo-opencmis-impl-2021.49.2.jar /OSGI-INF/cmis-versioning-contrib.xml
    <extension point="policies" target="org.nuxeo.ecm.core.api.versioning.VersioningService">
        <!-- Range [1, 10] for order is reserved for Nuxeo System Policies-->
        <!-- See https://doc.nuxeo.com/nxdoc/versioning/#-anchor-versioning-policies-versioning-policies-and-filters -->
        <policy beforeUpdate="true" id="no-versioning-for-cmis-before-update" increment="NONE" order="2">
          <filter-id>cmis-document</filter-id>
        </policy>
        <policy id="no-versioning-for-cmis-after-update" increment="NONE" order="2">
          <filter-id>cmis-document</filter-id>
        </policy>
      </extension>
  • nuxeo-platform-collections-core-2021.49.2.jar /OSGI-INF/collection-versioning-contrib.xml
    <extension point="policies" target="org.nuxeo.ecm.core.api.versioning.VersioningService">
        <!-- Range [1, 10] for order is reserved for Nuxeo System Policies-->
        <!-- See https://doc.nuxeo.com/nxdoc/versioning/#-anchor-versioning-policies-versioning-policies-and-filters -->
        <policy beforeUpdate="true" id="no-versioning-for-collection-before-update" increment="NONE" order="2">
          <filter-id>collection-actions</filter-id>
        </policy>
        <policy beforeUpdate="false" id="no-versioning-for-collection-after-update" increment="NONE" order="2">
          <filter-id>collection-actions</filter-id>
        </policy>
      </extension>
  • nuxeo-platform-tag-2021.49.2.jar /OSGI-INF/faceted-tag-versioning-policy.xml
    <extension point="policies" target="org.nuxeo.ecm.core.api.versioning.VersioningService">
        <policy beforeUpdate="true" id="no-versioning-for-faceted-tag-before" increment="NONE" order="3">
          <filter-id>no-versioning-faceted-tag-filter</filter-id>
        </policy>
        <policy id="no-versioning-for-faceted-tag" increment="NONE" order="3">
          <filter-id>no-versioning-faceted-tag-filter</filter-id>
        </policy>
      </extension>